{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from IPython.display import display\n",
    "from IPython.utils.traitlets import link\n",
    "\n",
    "from chemview import MolecularViewer\n",
    "\n",
    "from chemlab.notebook import download_molecule\n",
    "\n",
    "butane = download_molecule('butane')\n",
    "ethane = download_molecule('ethane')\n",
    "\n",
    "# Create the two molcular viewer widgets\n",
    "mv1 = MolecularViewer(butane.r_array, {'atom_types': butane.type_array,\n",
    "                                       'bonds': butane.bonds})\n",
    "mv1.wireframe()\n",
    "\n",
    "mv2 = MolecularViewer(ethane.r_array, {'atom_types': ethane.type_array,\n",
    "                                       'butane': ethane.bonds})\n",
    "mv2.wireframe()\n",
    "\n",
    "# Link their attributes camera_str together\n",
    "link((mv1, 'camera_str'), (mv2, 'camera_str'))\n",
    "\n",
    "display(mv1)\n",
    "display(mv2)"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python [default]",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
